#!/bin/bash

start=`date +%s`

for i in {1..1000000}
do
    ./sgconf-ng --login admin --password 123456 --port 44000 2> /dev/null > /dev/null &
    if [ $? != 0 ]
    then
        break
    fi

    if [ $(($i%1000)) = 0 ]
    then
        end=`date +%s`
        delta=$(($start-$end))
        echo $(($i/$delta))
    fi
done

end=`date +%s`

delta=$(($start-$end))

echo $delta
